<?php 

	require_once("CriarSessao.class.php");
	
	class Seguranca{
		
		public $sessao;
		
		public function __construct(){
		
			$this->sessao = new CriarSessao();
			
		}
			
		public function segurancaSessao(){
			
			if(!($this->sessao->getValue(""))){
				echo '<script type="text/javascript">
							window.location.href="index.php";
						</script>';
			}
		}
		
		public function segurancaString($string){
		
			$string = str_replace(" and ", "", $string);
			$string = str_replace(" or ", "", $string);
			$string = str_replace("select ", "", $string);
			$string = str_replace("delete ", "", $string);
			$string = str_replace("create ", "", $string);
			$string = str_replace("drop ", "", $string);
			$string = str_replace("update ", "", $string);
			$string = str_replace("drop table ", "", $string);
			$string = str_replace("show table ", "", $string);
			$string = str_replace("applet", "", $string);
			$string = str_replace("object", "", $string);
			$string = str_replace("'", "", $string);
			$string = str_replace("#", "", $string);
			$string = str_replace("=", "", $string);
			$string = str_replace("--", "", $string);
			$string = str_replace("-", "", $string);
			$string = str_replace(";", "", $string);	
			$string = str_replace("*", "", $string);
			$string = str_replace(";", "", $string);
			$string = str_replace('"', "", $string);	
			escapeshellcmd($string);
			$string = trim($string);
			
			return $string;																																					
		}	
	}
?>